package com.gfxy.ms.demo.lijixin.controller;

import com.gfxy.ms.demo.lijixin.LijixinSemester;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: lijixin 2022/1/4 5:03 下午
 */
@RequestMapping("/lijixin-semester")
@RestController
public class LijixinSemesterController {

    @RequestMapping("/list")
    // semester/list
    public List<LijixinSemester> getSemesterList(){
        List<LijixinSemester> result = new ArrayList<>();

        LijixinSemester semester1 = new LijixinSemester();
        semester1.setId("2020-2021-2");
        semester1.setName("2020-2021学年第二学期");
        semester1.setState(1);
        semester1.setStartDate("2021-03-01");
        semester1.setEndDate("2021-08-26");

        LijixinSemester semester2 = new LijixinSemester();
        semester2.setId("2020-2021-1");
        semester2.setName("2020-2021学年第一学期");
        semester2.setState(0);
        semester2.setStartDate("2020-08-31");
        semester2.setEndDate("2021-02-28");

        result.add(semester1);
        result.add(semester2);

        return result;
    }
}
